<template>
  <div id="app">
      
    <nav>
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> |
      <router-link to="/login">Login</router-link> |
      <router-link to="/todo">Todo</router-link>|
      <router-link to="/regis">Register</router-link>
    </nav>
    <vue-particles
        color="#dedede"
        :particleOpacity="0.7"
        :particlesNumber="80"
        shapeType="circle"
        :particleSize="4"
        linesColor="#dedede"
        :linesWidth="1"
        :lineLinked="true"
        :lineOpacity="0.4"
        :linesDistance="150"
        :moveSpeed="3"
        :hoverEffect="true"
        hoverMode="grab"
        :clickEffect="true"
        clickMode="push"
      >
      </vue-particles>
    <router-view/>
    
  </div>
</template>

<style>
 #particles-js{
    width: 100%;
    height: calc(100% - 100px);
    position: absolute; 
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>

<script>

export default({
  name: 'App',
  data(){
    return{
      
    }
  },
  mounted() {
    const user = JSON.parse(localStorage.getItem('user'));
    if(user!=null){
      this.$store.state.user = user;
      this.$store.state.isLogin = true;
    }
  },
})
</script>